package com.huazhi.wzsnw.constant;

import java.util.*;

/**
 * @author zhengch
 * @date 2021年07月19日 2:19 下午
 */
public class DtuMapUtil {
    private static DtuMapUtil dtuMapUtil;
    private static List<String> numberList = new ArrayList<>();
    private static Map<String, Date> heartMap = new HashMap<>();
    private static Map<String, Date> sendMap = new HashMap<>();
    private  static  Map<String,String> numAndData =  new HashMap<>();
    private DtuMapUtil() {

    }

    public static DtuMapUtil getInstance() {
        if (dtuMapUtil == null) {
            dtuMapUtil = new DtuMapUtil();
        }
        return dtuMapUtil;
    }

    public void addForNumberList(String number) {
        if (!numberList.contains(number)) {
            numberList.add(number);
            System.out.println("------------------添加成功,numberList现有" + numberList.size() + "个元素-----------------------");
        }
    }

    public List<String> getNumberList() {
        return numberList;
    }

    public void addForHeartMap(String number) {
        heartMap.put(number, new Date());
        System.out.println("------------------添加成功,HeartMap现有" + heartMap.size() + "个元素-----------------------");
    }

    public Map<String, Date> getHeartMap() {
        return heartMap;
    }

    public void addForSendMap(String number) {
        sendMap.put(number, new Date());
        System.out.println("------------------添加成功,sendMap现有" + sendMap.size() + "个元素-----------------------");
    }


    public Map<String, Date> getSendMap() {
        return sendMap;
    }


}
